<script>
export default {
  name: 'ContentPage',
  data() {
    return {
      cards: [
        {
          id: 1,
          normalIcon: 'content1-1.png',
          hoverIcon: 'content1-2.png',
          text: [
			'通过采购订单管理、库存监控、供应商协作等核心模块，实现采购流程的透明化与高效化、确保货物信息的准确性与可追溯性。'
          ]
        },
        {
          id: 2,
          normalIcon: 'content2-1.png',
          hoverIcon: 'content2-2.png',
          text: [
            '透明化为基础，逐步强化数字化应用和数字化决策，优化生产制造流程，提升生产效率、降低生产成本、加快产品交付，提升企业核心竞争力。'
          ]
        },
        {
          id: 3,
          normalIcon: 'content3-1.png',
          hoverIcon: 'content3-2.png',
          text: [
            '通过集成先进的防伪标签与追溯技术，企业能够实时掌握物品流向，精准定位窜货行为，确保产品从生产到消费的每一个环节都透明可控。'
          ]
        },
        {
          id: 4,
          normalIcon: 'content4-1.png',
          hoverIcon: 'content4-2.png',
          text: [
            '以数字化标识为基础，强化设备信息的追溯与共享，优化设备管理流程，提升设备利用率、降低维护成本、促进资源高效配置。'
          ]
        },
        {
          id: 5,
          normalIcon: 'content5-1.png',
          hoverIcon: 'content5-2.png',
          text: [
            '通过实时信息捕捉优化服务流程、提升客户体验、增强品牌价值，实现售后服务从问题解决到价值创造的转变。'
          ]
        }
      ]
    }
  }
}
</script>

<template>
  <div class="content-container">
    <!-- 标题区域 -->
    <div class="title-section">
      <!-- <span class="title-part1">国家级平台</span> -->
      <span class="title-part1">全场景业务</span>
      <span class="title-part2">全面互联</span>
    </div>

    <!-- 图片区域（添加横向滚动容器） -->
    <div class="cards-wrapper">
      <div class="cards-scroll-container">
        <div class="image-grid">
          <div
              v-for="card in cards"
              :key="card.id"
              class="image-card"
          >
            <div class="card-number">{{ card.id.toString().padStart(2, '0') }}</div>
<!--            <div
                class="card-icon"
                :style="{ backgroundImage: `url(${require('@/assets/home/' + card.normalIcon)})` }"
            ></div> -->
            <div
                class="card-icon"
                :style="{ backgroundImage: `url(${require('@/assets/home/appIntroduction/' + card.normalIcon)})` }"
            ></div>
            <!-- rui 250621 -->
            <div class="card-text">
              <p v-for="(line, index) in card.text" :key="index">{{ line }}</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.content-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center; /* 使子元素水平居中 */
}

/* 标题样式 */
.title-section {
  font-size: 43px;
  font-weight: 900;
  line-height: 40px;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 50px;
  width: 100%;
}

.title-part1 {
  color: #000;
}

.title-part2 {
  color: #f2a11b;
}

/* 卡片容器包裹层 */
.cards-wrapper {
  width: 100%;
  display: flex;
  justify-content: center; /* 水平居中 */
}

/* 横向滚动容器 */
.cards-scroll-container {
  width: 100%;
  max-width: 1440px; /* 限制最大宽度 */
  overflow-x: auto;
  padding-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

/* 隐藏滚动条（可选） */
.cards-scroll-container::-webkit-scrollbar {
  display: none;
}

/* 图片网格布局 */
.image-grid {
  display: inline-flex;
  gap: 20px;
  min-width: min-content; /* 根据内容调整最小宽度 */
  padding: 0 20px; /* 两侧留白 */
  justify-content: center; /* 卡片组居中 */
}

/* 卡片固定尺寸 */
.image-card {
  flex: 0 0 240px;
  width: 240px;
  height: 256px;
  background-image: url('../../assets/home/product-bg.png');
  background-size: 100% 100%;
  background-color: #fff;
  padding: 20px;
  position: relative;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* 卡片悬停效果 */
.image-card:hover {
  background-color: #39558D;
  transform: translateY(-5px);
}

.image-card:hover .card-text {
  color: white;
}

.image-card:hover .card-number {
  color: rgba(255, 255, 255, 0.2);
}

/* 卡片数字 */
.card-number {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 42px; /* 调小一点适应卡片 */
  font-weight: 700;
  color: #e4e4e4;
  transition: all 0.3s ease;
}

/* 卡片图标 - 初始状态 */
.card-icon {
  height: 81px; /* 调小一点适应卡片 */
  width: 78px;
  margin: 10px auto 15px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
/* ycr 250621 */
.card-icon {
  height: 121px; 
  width: 118px; 
  margin: 0px auto 0px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

/* 卡片文字 */
.card-text {
  font-size: 12px;
  line-height: 1.6;
  color: #333;
  transition: all 0.3s ease;
  margin-top: auto; /* 使文字靠底部 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 5; /* 限制显示行数 */
  -webkit-box-orient: vertical;
}

/* 为每个卡片设置悬停图标 */
/* .image-card:nth-child(1):hover .card-icon {
  background-image: url('@/assets/home/content1-2.png') !important;
}
.image-card:nth-child(2):hover .card-icon {
  background-image: url('@/assets/home/content2-2.png') !important;
}
.image-card:nth-child(3):hover .card-icon {
  background-image: url('@/assets/home/content3-2.png') !important;
}
.image-card:nth-child(4):hover .card-icon {
  background-image: url('@/assets/home/content4-2.png') !important;
}
.image-card:nth-child(5):hover .card-icon {
  background-image: url('@/assets/home/content5-2.png') !important;
} */

.image-card:nth-child(1):hover .card-icon {
  background-image: url('@/assets/home/appIntroduction/content1-2.png') !important;
}
.image-card:nth-child(2):hover .card-icon {
  background-image: url('@/assets/home/appIntroduction/content2-2.png') !important;
}
.image-card:nth-child(3):hover .card-icon {
  background-image: url('@/assets/home/appIntroduction/content3-2.png') !important;
}
.image-card:nth-child(4):hover .card-icon {
  background-image: url('@/assets/home/appIntroduction/content4-2.png') !important;
}
.image-card:nth-child(5):hover .card-icon {
  background-image: url('@/assets/home/appIntroduction/content5-2.png') !important;
}
/* rui 250621 */

</style>